﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Zor_Modes;
using Zor_Tools;
using Zor_Bll;
using Newtonsoft.Json.Linq;

namespace Zor_API.Controllers   
{
    public class TaxRecordController : ApiController
    {
        /// <summary>
        /// 获取用户缴税信息
        /// </summary>
        /// <param name="type">租户类型（1:个人   2:企业）</param>
        /// <param name="name">业主名称/单位名称</param>
        /// <param name="number">身份证号/税号</param>
        /// <returns></returns>
        [HttpPost]
        public List<TaxRecord> TaxRecordList([FromBody]TaxRecord tr) 
        {
            List<TaxRecord> taxRecordList = new List<TaxRecord>();
            if (tr.Tenant_Type == 1)
            {
                taxRecordList = TaxRecord_Bll.GetTaxRecordList(tr.Tenant_Type, tr.Tenant_Name, tr.Tenant_IDNumber);
            }
            else if (tr.Tenant_Type == 2)
            {
                taxRecordList = TaxRecord_Bll.GetTaxRecordList(tr.Tenant_Type, tr.Tenant_Name, tr.Tenant_IDNumber);
            }
            return taxRecordList;
        }

        /// <summary>
        /// 纳税预警信息
        /// </summary>
        /// <param name="type">租户类型（1:个人   2:企业）</param>
        /// <returns></returns>
        [HttpPost]
        public List<TaxRecord> TaxRecordListByType([FromBody]TaxRecord tr) 
        { 
            return TaxRecord_Bll.GetTaxRecord(tr.Tenant_Type,tr.Tenant_Name,tr.Tenant_IDNumber);
        }
    }
}
